const {
  $Toast
} = require('../../utils/iview/base/index');
const Tools = require('../../utils/modules/Tools');
import NetWork from '../../utils/modules/NetWork';

const app = getApp();


Page({
  data: {
    auth: true,
    isloade: {
      hidden: false
    },
    _baseUrl: app.globalData._baseUrl,
    _imgPath: app.globalData._imgPath,
    _imgPaths: app.globalData._imgPaths,
    _backImg: app.globalData._backImg,
    img: [],
    user_type: 1,
    designer_id: '',
    openid: app.globalData.openid,
    shopName: '',
    shopId: '',
    userInfo: '',
    user: {},

  },
  onLoad(e) {
    // var _that=this
    // _that.setData({
    //   wan: e.wan,
    // })
    // console.log(_that.data.wan,"wang")

  },


  contact() {
    var _that = this;
    var net = new NetWork(_that.data._baseUrl);
    net._request({
      url: 'api/v1/company-contact',
      data: {

      },
      method: 'GET',
    }, '', res => {
      if (res.data.error_code == 0) {
        _that.setData({
          cont: res.data.data
        })
        // console.log(res.data.data, "cotn12145454")

      }
    }, res => {
      if (res.data.error_code == 400 && res.data.msg == 'token无效或已过期') {
        //token过期 重新执行该函数
        app.refreshtoken(token);
        setTimeout(() => {
          _that.contact();
        }, 1500)
      }
    })
  },


  onShow: function () {
    var _that = this;
    _that.contact();

  },
  
})